//
//  StringUtils.h
//  JQBV2
//
//  Created by 吕飞俊 on 14-8-22.
//  Copyright (c) 2014年 EFunds. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class StringUtils;

typedef enum :NSInteger{
    EnumOrderListStyle = 0,
    EnumOrderDetailStyle
}OrderStatusType;

@interface StringUtils : NSObject

/**根据宽度计算高度*/
+(CGFloat)getHeightWithString:(NSString *)string
                        width:(CGFloat)width
                         font:(UIFont *)font
                        color:(UIColor *)color;

#pragma mark nil

/**
 *  NSNULL类型转换为@""
 *
 *  @param string
 *
 *  @return 入参为NSULL类型时返回@“”，否则返回原字符串
 */
+(NSString *)emptyStringReplaceNSNull:(id)string;

/**
 *  判断参数是否为空
 *
 *  @param string 需要判断的参数
 *
 *  @return YES表示参数为空,NO表示参数不为空
 */
+ (BOOL)isEmptyString:(id)string;

+(NSString *)getString:(id)string;

/**nil等字符转换为@“0”*/
+(NSString *)zeroReplayEmptyString:(id)string;

#pragma mark format

+(NSString *)numberFormat:(NSInteger)num;

/**
 *  金额格式化
 *
 *  @param string 金额
 *
 *  @return 格式化后的金额,保留两位小数 
 */
+(NSString *)amountFormat:(NSString *)string;

/**金额格式化：返回带￥标示的金额*/
+ (NSString *)amountMarkFormat:(NSString *)string;

+ (BOOL)isValidateEmail:(NSString *)email;

+ (BOOL)isValidateIDCard:(NSString *)IDCard;

#pragma  mark save

+(NSDictionary *)getUserDefaultsObjForKey:(NSString *)key;

+(void)setUserDefaultsObj:(NSDictionary *)obj forKey:(NSString *)key;

#pragma mark date

/**时间戳转换为时间*/
+(NSDate *)timeIntervalChangeToData:(NSString *)timeInterval;

#pragma mark codeString

+(NSString*)urlEncodeString:(NSString*)unencodedString;

//URLDEcode
+(NSString*)urlDecodeString:(NSString*)encodedString;

@end
